// Spectrum analyzer read values will be kept here.
int Spectrum[7];


float Weight[] = {0.00 ,
                  0.05 ,
                  0.25,
                  0.25,
                  0.20,
                  0.20,
                  0.05};

void calculateAudioMode(const int* hsvin, int* hsvout,float minAmplitude){
  
  hsvout[0] = hsvin[0];
  hsvout[1] = hsvin[1];

  byte band = 0;
  float amp = 0;
  for(band=0;band <7; band++)
  {
//    Spectrum[band] = (analogRead(spectrumAnalog)  analogRead(spectrumAnalog) ) / 2; //Read twice and take the average by dividing by 2
    Spectrum[band] = analogRead(spectrumAnalog);
    digitalWrite(spectrumStrobe,HIGH);
    digitalWrite(spectrumStrobe,LOW);
    amp += Spectrum[band] * Weight[band];
    
  }
  Serial.print("amp before : ");
  Serial.println(amp);
  amp = max(50 * minAmplitude ,(amp - 61) ); 
  Serial.print("amp : ");
  Serial.println(amp);
  hsvout[2] = max(min(100 , amp), 0);
}
